package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpFaUserDao;
import com.financing.platform.dto.FpFaUserDTO;
import com.financing.platform.dto.vo.FpFaUserVoDTO;
import com.financing.platform.service.IFpFaUserService;
import com.financing.platform.vo.JcsYxtActivityVO;
import com.financing.platform.vo.UserAllSumVO;
import com.financing.platform.vo.UserShopRoleVO;
/**
 * fp_fa_user  
 * FA人员信息表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFaUserService")
public class FpFaUserServiceImpl implements IFpFaUserService{

	@Autowired
	private IFpFaUserDao fpFaUserDao;

	@Override
	public int insert(FpFaUserDTO fpFaUser) throws SQLException {
		return fpFaUserDao.insert(fpFaUser);
	}

	@Override
	public void update(FpFaUserDTO fpFaUser) throws SQLException {
		fpFaUserDao.update(fpFaUser);
	}

	@Override
	public void updateForce(FpFaUserDTO fpFaUser) throws SQLException {
		fpFaUserDao.updateForce(fpFaUser);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpFaUserDao.delete(id);
	}
	
	@Override
	public List<FpFaUserDTO> queryList(FpFaUserDTO fpFaUser) throws SQLException {
		return fpFaUserDao.queryList(fpFaUser);
	}

	@Override
	public int queryListCount(FpFaUserDTO fpFaUser) throws SQLException {
		return fpFaUserDao.queryListCount(fpFaUser);
	}
	
	@Override
	public int queryBySfaCount(FpFaUserDTO fpFaUser) throws SQLException {
		return fpFaUserDao.queryBySfaCount(fpFaUser);
	}

	
	@Override
	public FpFaUserDTO loadById(Integer id) throws SQLException {
		return fpFaUserDao.loadById(id);
	}
 	@Override
	public FpFaUserDTO queryListGetFirst(FpFaUserDTO fpFaUser)
			throws SQLException {
		 List<FpFaUserDTO> queryList = queryList(fpFaUser);
		 if(queryList==null||queryList.size()==0){
			 return new FpFaUserDTO();
		 }
		 return queryList.get(0);
	}

	public List<FpFaUserVoDTO> queryBySfaTimeCount(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		return fpFaUserDao.queryBySfaTimeCount(userDTO);
	}

	public List<FpFaUserVoDTO> queryByJcsCount(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		return fpFaUserDao.queryByJcsCount(userDTO);
	}

	public List<FpFaUserVoDTO> queryBySfaNowDayRole1(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		
		return fpFaUserDao.queryBySfaNowDayRole1(userDTO);
	}

	public List<JcsYxtActivityVO> queryActivityCount(FpFaUserDTO faUser) throws SQLException {
		// TODO Auto-generated method stub
		return fpFaUserDao.queryActivityCount(faUser);
	}
  
  @Override
	public int queryUserCount(FpFaUserDTO fpFaUserDTO)throws SQLException {
		// TODO Auto-generated method stub
		return fpFaUserDao.queryUserCount(fpFaUserDTO);
	}

	public List<UserShopRoleVO> queryListCountByUshopRole(FpFaUserDTO userDTO)throws SQLException {
		// TODO Auto-generated method stub
		
		return fpFaUserDao.queryListCountByUshopRole(userDTO);
	}

	public List<UserAllSumVO> queryBYAllSum(FpFaUserDTO uDTO)throws SQLException  {
		// TODO Auto-generated method stub
		return fpFaUserDao.queryBYAllSum(uDTO);
	}
}